{$CLEO .cs}
// : " "
// : 1.0 [ 2016]
// : kenking 
// E-mail: kenking@rambler.ru
if
  8AA9: not is_game_version_original
then
    0ACD: show_text_highpriority "for version 1.0" time 5000
    0A93: end_custom_thread
end

while true
wait 0
    if
      Player.Defined($PLAYER_CHAR)
    then
        00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
        if
          0AE2: 0@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 200.0 find_next 0 pass_wrecked 1 //IF and SET
        then
            repeat
              0441: 4@ = car 0@ model
              if 
                0A01: model 4@ car
              then
                  0A97: 5@ = car 0@ struct
                  0A8E: 31@ = 5@ + 0x18 // int 
                  0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
                  0AA7: call_function 0x4C5400 num_params 2 pop 2 _nodename "dvan_l" _rwObject 31@ _store_to 6@
                  0AA7: call_function 0x4C5400 num_params 2 pop 2 _nodename "dvan_r" _rwObject 31@ _store_to 7@
                  0AA7: call_function 0x4C5400 num_params 2 pop 2 _nodename "dmbus_l" _rwObject 31@ _store_to 16@
                  0AA7: call_function 0x4C5400 num_params 2 pop 2 _nodename "dmbus_r" _rwObject 31@ _store_to 17@
                  0AA7: call_function 0x4C5400 num_params 2 pop 2 _nodename "dmm_r" _rwObject 31@ _store_to 10@
                  //-------  -----------------------------               
                  if 
                    6@ > 0
                  then
                      095F: get_car 0@ componentA 2 rotation_to 8@
                      if
                        8@ > -0.9 // 
                      then
                          0A8E: 29@ = 6@ + 68 
                          0A8C: write_memory 29@ size 4 value 8@ virtual_protect 0
                      end    
                  end  
                  //-------  ----------------------------
                  if 
                    7@ > 0
                  then
                      095F: get_car 0@ componentA 3 rotation_to 9@
                      9@ *= -1.0
                      if
                        9@ > -0.9 // 
                      then  
                          0A8E: 30@ = 7@ + 68
                          0A8C: write_memory 30@ size 4 value 9@ virtual_protect 0
                      end    
                  end
                  //-------  -----------------------------
                  if 
                    16@ > 0
                  then
                      095F: get_car 0@ componentA 4 rotation_to 18@
                      0A8E: 25@ = 16@ + 64
                      0A8E: 26@ = 16@ + 68
                      0A8C: write_memory 26@ size 4 value 18@ virtual_protect 0
                      if
                        18@ <> 0.0 
                      then  
                          0A8C: write_memory 25@ size 4 value -0.15 virtual_protect 0
                      else
                          0A8C: write_memory 25@ size 4 value 0.0 virtual_protect 0    
                      end   
                  end  
                  //-------  ----------------------------                 
                  if 
                    17@ > 0
                  then
                      095F: get_car 0@ componentA 5 rotation_to 19@
                      19@ *= -1.0
                      0A8E: 27@ = 17@ + 64
                      0A8E: 28@ = 17@ + 68
                      0A8C: write_memory 28@ size 4 value 19@ virtual_protect 0
                      if
                        19@ <> 0.0 
                      then  
                          0A8C: write_memory 27@ size 4 value 0.15 virtual_protect 0
                      else
                          0A8C: write_memory 27@ size 4 value 0.0 virtual_protect 0    
                      end     
                  end  
                  //------- ------------------------------
                  if 
                    10@ > 0
                  then
                      095F: get_car 0@ componentA 1 rotation_to 11@
                      0A8E: 12@ = 10@ + 64
                      0A8E: 13@ = 10@ + 68
                      0A8C: write_memory 13@ size 4 value 11@ virtual_protect 0
                      if
                        11@ <> 0.0 
                      then  
                          0A8C: write_memory 12@ size 4 value 0.15 virtual_protect 0
                      else
                          0A8C: write_memory 12@ size 4 value 0.0 virtual_protect 0    
                      end     
                  end  
                  //--------------------------------------------------------
              end   
            until 8AE2: not 0@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 200.0 find_next 1 pass_wrecked 1
        end
    end
end